#include "stack.h"
#include "queue.h"
#include <queue>
#include "priority_queue.h"
void stack_test()
{
    //wanghao::stcak<int,vector<int>> s;
    wanghao::stcak<int> s;
    s.push(1);
    s.push(2);
    s.push(3);
    s.push(4);
    while(!s.empty())
    {
        cout << s.top() << " ";
        s.pop();
    }
    cout << endl;

}
void queue_test()
{
    //vector不能适配队列,因为vector不支持头删
    wanghao::queue<int,list<int>> q;
    q.push(1);
    q.push(2);
    q.push(3);
    q.push(4);
    q.push(5);
    while(!q.empty())
    {
        cout << q.front() << " ";
        q.pop();
    }
    cout << endl;
}
void priority_queue_test()
{
    //默认最大的优先级高
    vector<int> v({8,2,5,3,7,9,10,4,6,1});
    //priority_queue<int> pq(v.begin(),v.end());
    //小堆 
    // priority_queue<int,vector<int>,greater<int>> pq(v.begin(),v.end());
    // while(!pq.empty())
    // {
    //     cout << pq.top() << " ";
    //     pq.pop();
    // }
    // cout << endl;

    wanghao::priority_queue<int,vector<int>,wanghao::greater<int>> pq(v.begin(),v.end());
    // for(auto& e : v)
    // {
    //     pq.push(e);
    // }
    while(!pq.empty())
    {
        cout << pq.top() << " ";
        pq.pop();
    }
    cout << endl;
    
}
int main()
{
    priority_queue_test();
    return 0;
}
